package com.jxb.ractBase;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

import reactor.core.publisher.Flux;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/10/23 21:40
 **/
public class ZipTest {

    public static void main(String[] args) throws InterruptedException {
        Flux<Integer> just1 = Flux.just(1, 2, 3, 4, 5).delayElements(Duration.ofSeconds(1));
        Flux<Integer> just2 = Flux.just(10, 20, 30, 40,50);
        Flux<Integer> just3 = Flux.just(100, 200, 300, 400, 500);
        Flux.zip(just1,just2,just3)
                .map(item->item.getT1() + item.getT2() + item.getT3())
                .subscribe(System.out::println);

        TimeUnit.SECONDS.sleep(Integer.MAX_VALUE );
    }

}
